@extends('common.header')
<head>
<!-- 1.添加meta csrf_token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>收藏列表</title>
<link rel="shortcut icon" href="{{ asset('/images/favicon.ico') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('/css/person/person-center.css') }}"/>
<script src=" {{ asset('/js/jquery-1.9.1.min.js') }} "></script>
<script type="text/javascript">

    <!-- 2.设置全局ajax选项 -->
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    // 获取 token
    var _token = $('meta[name="csrf-token"]').attr('content');
	
	
	// 取消 收藏
	function cancelCollect(collect_id)
	{
		if( confirm('确认收藏吗?') )
		{
			$.ajax({ 
				type : 'post', 
				url : "{{ url('/cancelcollect') }}", 
				data:{ collect_id:collect_id,_token:_token},
				async:true,    					
				dataType:"json",
				success:function(back){ 
					if( back['show_info']=='取消收藏成功' )
					{
						location.reload();
					}else
					{
						alert(back['show_info']);
					}
					
				}
			});
		}
	}


</script>
</head>
<body style="background:#fff;">

<!--面包屑导航-->
<div style="width: 1200px;height: 40px;line-height:40px;position: relative;margin: 110px auto 0">
    <ol style="float: left;overflow: hidden;color: #333;list-style: none;">
        <li style="float: left;margin-left: 5px">当前位置：</li>
        <li style="float: left;margin-left: 5px"><a href="{{ url('/') }}" style="color: #de1e30;margin-left: 5px">首页</a>
        </li>
        <li style="float: left;margin-left: 5px"><a href="{{ url('/personNal') }}" style="color: #de1e30;margin-left: 5px">>
            个人中心</a></li>
		<li style="float: left;margin-left: 5px">> 我的收藏</li>	
    </ol>
</div>

<div class="wrap" style="margin-top:10px">
  <!--发文，管理标题-->
    <div class="left_menu">
        <div class="menu_block admin">
            <a href="{{ url('/personNal') }}" class="menu_article">
                <i></i>
                我的资料
            </a>
			
        </div>
		<div class="menu_block admin_change_img">
            <a href="{{ url('/changuserpic') }}" class="menu_article">
                <i></i>
                修改头像
            </a>
			
        </div>
		<div class="menu_block admin-focus">
            <a href="{{ url('/myfans') }}" class="menu_article">
                <i></i>
                我的关注
            </a>
        </div>
		<div class="menu_block article-manage">
			<a href="{{ url('/articleManage') }}" class="menu_article">
				<i></i>
				文章管理
			</a>
		</div>
		<div class="menu_block menu_recharge">
            <a href="{{ url('/recharge') }}" class="menu_article">
                <i></i>
                充值中心
            </a>
        </div>
		<div class="menu_block menu_recharge">
            <a href="{{ url('/recharge_record') }}" class="menu_article">
                <i></i>
                充值记录
            </a>
        </div>
		<div class="menu_block article-colle" style="background:#eee;">
			<a href="{{ url('/mycollect') }}" class="menu_article">
				<i></i>
				我的收藏
			</a>
		</div>
        <div class="menu_block article-publi">
            <a href="{{ url('/new_article') }}" class="menu_article">
                <i></i>
                发表文章
            </a>
        </div>
		<div class="menu_block article-recommend">
            <a href="{{ url('/recommendgame') }}" class="menu_article">
                <i></i>
                竞彩推荐
            </a>
        </div>
    </div>
    
   <!--发文，管理内容-->
    <div class="right_main">
		

        <!--文章列表-->
        <div class="admin_main right_body" id="main1">
            <div class="pagelet-write">
                <a href="#" class="page_tab">收藏列表</a>
            </div>
            <div class="err_edit" style="display:none"></div>
            <div class="edit_body">


                <!-- 文章列表 -->
                <ul>
                
					@forelse( $collect as $key => $collect_info )
                    <li>
						<!-- 资讯 -->
                        @if( $collect_info['type']==1 )
							<a target='_blank' href="{{ url('/news') }}/{{ $collect_info['id'] }}" class="admin_img">
								<img src="{{ $collect_info['pic_url'] }}"/>
							</a>
							<div>
								<a href="{{ url('/news') }}/{{ $collect_info['id'] }}" class="admin_tit" style="word-break:break-all;">
									<h4>{{ $collect_info['title'] }}</h4>
									资讯
								</a>
								<div>
									<div class="admin_other">
										<span>{{ $collect_info['comments_total'] }}</span>评论<i></i>
										{{ $collect_info['create_at'] }}
									</div>
								</div>
								<div class="admin_btn">
									<a onclick="cancelCollect({{ $collect_info['collect_id'] }});">取消收藏</a>
								</div>
							</div>
						<!-- 文章 -->
						@elseif( $collect_info['type']==2 )
							<a target='_blank' href="{{ url('/article') }}/{{ $collect_info['id'] }}" class="admin_img">
								<img src="{{ $collect_info['pic_url'] }}"/>
							</a>
							<div>
								<a href="{{ url('/article') }}/{{ $collect_info['id'] }}" class="admin_tit" style="word-break:break-all;">
									<h4>{{ $collect_info['title'] }}</h4>
									文章
								</a>
								<div>
									<div class="admin_other">
										<span>{{ $collect_info['comments_total'] }}</span>评论<i></i>
										{{ $collect_info['create_at'] }}
									</div>
								</div>
								<div class="admin_btn">
									<a onclick="cancelCollect({{ $collect_info['collect_id'] }});">取消收藏</a>
								</div>
							</div>
						<!-- 图库 -->
						@elseif( $collect_info['type']==3 )
							<a target='_blank' href="{{ url('/photoDetail') }}/{{ $collect_info['id'] }}" class="admin_img">
								<img src="{{ $collect_info['pic_url'] }}"/>
							</a>
							<div>
								<a href="{{ url('/photoDetail') }}/{{ $collect_info['id'] }}" class="admin_tit" style="word-break:break-all;">
									<h4>{{ $collect_info['title'] }}</h4>
									图库
								</a>
								<div>
									<div class="admin_other">
										<span>{{ $collect_info['comments_total'] }}</span>评论<i></i>
										{{ $collect_info['create_at'] }}
									</div>
								</div>
								<div class="admin_btn">
									<a onclick="cancelCollect({{ $collect_info['collect_id'] }});">取消收藏</a>
								</div>
							</div>
						@else
						@endif
                        
                    </li>
					@empty
                    
					
					<!--没有文章时显示-->
                    <div class="none_article">
                        <img src="{{ asset('/images/articles/nothing.png') }}" alt="">
                        <p>您还没有收藏任何文章</p>
                    </div>
					@endforelse
                 

                </ul>
            </div>
        </div>


    </div>

		
</div>


</div>

<div class="col-xs-6 col-md-2">

</div>

</div>


<div id="article"></div>

<!-- 分页 -->
<div style="width:70%;text-align:right;font-size:14px;">
	{{ $all_collects ->links() }} 
</div>


<script>
    $("#edit_tit").click(function () {
        if ($(".edit_hide").css("display") == "none") {
            $(".edit_hide").slideDown(1500);
        } else {
            $(".edit_hide").slideUp(1000);
        }
    });
</script>
<script>
    $(".grid-info").eq(0).show();
	$("#tab-tit a").click(function(){
    var num =$("#tab-tit a").index(this);
    $(".grid-info").hide();
    $(".grid-info").eq(num).show().slblings().hide();
  })
</script>

@extends('common.footer')

</body>
